package com.hu.flink12.api

import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment

/**
 * @Author: hujianjun
 * @Create Date: 2021/1/19 19:32
 * @Describe: 统一使用流执行入口可以在运行时指定使用流还是使用批模式
 */
object StreamBatchIntegration {
  def main(args: Array[String]): Unit = {
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    env.setParallelism(1)

    //    val textStream = env.readTextFile("C:\\Users\\hujianjun\\Documents\\WeChat Files\\wxid_fjdt8tlr2crc21\\FileStorage\\File\\2021-01\\README.md")
    val textStream = env.socketTextStream("localhost", 7777)
    textStream.print()
//    env.setRuntimeMode(RuntimeExecutionMode.BATCH)
    env.execute()
  }
}
